<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class ProjectRoadShow_model extends CI_Model {

    public $tablename = 'hpg_project_roadshow';

    public function __construct()
    {
        parent::__construct();
    }
    
    public function getInfoByProjectId($project_id){
        if( !$project_id ){
            return false;
        }
        $data = $this->db->from($this->tablename)->where('project_id', $project_id)->fetchOne();
        return $data ? $data : [];
    }
    
    public function insert($data){
        if( !$data ){
            return false;
        }
        $res = $this->db->insert($this->tablename, $data);
        return $this->db->insert_id();
    }
    
    public function update($map, $data){
        if( !$map || !$data ){
            return false;
        }
        $res = $this->db->update($this->tablename, $data, $map);
        return $res;
    }
}